package com.qianfeng.dbsm.impl;

import com.qianfeng.dbsm.dao.TotalDao;
import com.qianfeng.dbsm.service.TotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TotalServiceImpl implements TotalService {
    @Autowired
    private TotalDao totalDao;

    /**
     * 通过 订单状态 查询输入 订单状态 之后的订单总销售额
     * @param orderState
     * @return
     */
    @Override
    public double queryByTotalSales(Integer orderState) {
        double totalSales = totalDao.queryByTotalSales(orderState);
        return totalSales;
    }

    /**
     * 查询；通过 订单状态 查询输入 订单状态 之后的订单总销量；输入订单状态；输出订单总销量
     * @param orderState
     * @return
     */
    @Override
    public int queryByTotalSalesVolume(Integer orderState) {
        int totalSalesVolume=totalDao.queryByTotalSalesVolume(orderState);
        return totalSalesVolume;
    }
}
